{% extends 'bootbase.html' %}
{% load l10n %}
{% block title %}Acacia Meetlocatie {{object.name}}{% endblock title %}
{% block brandname %}{% endblock brandname %}
{% block navbar-right %}
{% endblock navbar-right %}
{% block breadcrumbs %}
<ol class="breadcrumb">
	<li><a href="{% url 'home' %}">Home</a></li>
	<li><a href="{% url 'acacia:project-list' %}">Projecten</a></li>
	<li><a href="{% url 'acacia:project-detail' object.project.id %}">{{object.project.name}}</a></li>
	<li><a href="{% url 'acacia:projectlocatie-detail' object.projectlocatie.id %}">{{object.projectlocatie.name}}</a></li>
	<li class="active"><a href="{% url 'acacia:meetlocatie-detail' object.id %}">{{object.name}}</a></li>
</ol>
{% endblock breadcrumbs %}
{% block admin_url %}meetlocatie/{{object.id}}{% endblock %}
{% block script %}
{{ block.super }}
{% localize off %}
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script>
var map;
function initialize() {
    var pos = new google.maps.LatLng({{object.latlon.y}},{{object.latlon.x}});
    map = new google.maps.Map(document.getElementById('map'), {
        zoom: {{zoom}},
        center: pos,
        mapTypeId: google.maps.MapTypeId.{{maptype}}
    });
    var marker = new google.maps.Marker({map: map, position: pos, title: "{{object.name}}" });
    var contentString = {{content|safe}};
	var infowindow = new google.maps.InfoWindow({content: contentString});
	google.maps.event.addListener(marker, 'click', function() {
    	infowindow.open(map,marker);
  	});
}
$(function(){initialize();});
</script>
{% endlocalize %}
{% endblock %}
{% block content %}
<div class = "container">
<div class = "row-fluid">
<h3>{{object.projectlocatie.name}} {{object.name}}</h3>
{{object.description|safe}}
</div>
<div id = map style="width:100%;height:400px;"></div>
<div class="row-fluid">
<table class="table table-striped">
<thead>
<tr>
<th>Gegevensbron</th>
<th>Bestanden</th>
<th>Parameters</th>
<th>Tijdreeksen</th>
<th>Begin</th>
<th>Einde</th>
<th>Laatste update</th>
</tr>
</thead>
<tbody>
{% for d in object.datasources.all %}
<tr>
<td><a href='{% url "acacia:datasource-detail" d.id %}'>{{d.name}}</a></td>
<td>{{d.filecount}}</td>
<td>{{d.parametercount}}</a></td>
<td>{{d.seriescount}}</td>
<td>{{d.start|default:"onbekend"}}</td>
<td>{{d.stop|default:"onbekend"}}</td>
<td>{{d.last_download|default:"onbekend"}}</td>
</tr>
{% empty %}
    <div>Geen gegevensbonnen gevonden</div>
{% endfor %}
</tbody>
</table>
</div>
<!-- <div class="text-right"> -->
<!-- <a href="{% url 'acacia:meetlocatie-zip' object.id %}" class="btn btn-default active" data-toggle="tooltip" title="Alle bestanden van deze meetlocatie downloaden" id="download">Downloaden</a> -->
<!-- </div> -->
</div>
</div>
{% endblock content %}
